package avicit.bdp.dcs.semistructure.dto;

/**
 * {"serial":1,"name":"name","type":"TEXT"}
 */
public class ColumnRuleDto implements Comparable {

    private Integer serial;
    private String name;
    private String type;

    public Integer getSerial() {
        return serial;
    }

    public void setSerial(Integer serial) {
        this.serial = serial;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public int compareTo(Object o) {
        if(o instanceof ColumnRuleDto) {
            ColumnRuleDto emp = (ColumnRuleDto) o;
            // 换名称升序排序
            return this.name.compareTo(emp.getName());
        }
        throw new ClassCastException("不能转换为ColumnRuleDto类型的对象...");
    }

}
